home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-15 | 1.6 KB | 56 lines | [TEXT/KAHL] |
- /******************************************************************************
- CMultiState.c
-
- The MultiState Class
-
- A standard AppMaker MultiState button. The control's value is incremented
- each time the button is pushed, and loops from the maximum value to the
- minimum value for the control. The clickCmd, if set, is executed just
- after the value is changed by the superclass.
-
- SUPERCLASS = CAMButton
-
- Copyright © 1991 Bowers Development Corporation. All rights reserved.
-
- ******************************************************************************/
-
- #include "CMultiState.h"
-
- /******************************************************************************
- DoGoodClick
-
- A MultiState responds to a good click (the mouse being pressed
- and released within the button) by changing its value and then
- calling the inherited method, which will DoCommand (clickCmd)
- if clickCmd is not NULL.
- ******************************************************************************/
-
- void CMultiState::DoGoodClick (short whichPart)
- /* Will always be inButton */
- {
- SetNextState ();
- inherited::DoGoodClick (whichPart);
-
- } /* DoGoodClick */
-
- /******************************************************************************
- SetNextState
-
- Increments the MultiState's value, wrapping from Max to Min if
- needed.
- ******************************************************************************/
-
- void CMultiState::SetNextState (void)
- {
- short oldValue;
-
- oldValue = GetValue ();
- if (oldValue >= GetMaxValue ()) {
- SetValue (GetMinValue ());
- } else {
- SetValue (oldValue + 1);
- }
-
- } /* SetNextState */
-
-